﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class TourPackageController
    {
        public int InsertTourPackage(TourPackageInfo info)
        {
            return SQL.InsertTourPackage(info.TourPackageName, info.Tickets, info.TicketPrices, info.Hotels, info.HotelPrices, info.Restaurant, info.RestaurantPrices, info.Visas, info.VisaPrices, info.Insurance, info.InsurancePrices, info.TravelGuideCashs, info.TravelGuideCashPrices, info.Services, info.ServicePrices, info.TotalPrice, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status, info.ScheduleId, info.Description, info.TourPackageCode, info.MartName, info.Commissions, info.CommissionPrices);
        }
        public void UpdateTourPackage(TourPackageInfo info)
        {
            SQL.UpdateTourPackage(info.TourPackageId, info.TourPackageName, info.Tickets, info.TicketPrices, info.Hotels, info.HotelPrices, info.Restaurant, info.RestaurantPrices, info.Visas, info.VisaPrices, info.Insurance, info.InsurancePrices, info.TravelGuideCashs, info.TravelGuideCashPrices, info.Services, info.ServicePrices, info.TotalPrice, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status, info.ScheduleId, info.Description, info.TourPackageCode, info.MartName, info.Commissions, info.CommissionPrices);
        }
        public void DeleteTourPackage(TourPackageInfo info)
        {
            DeleteTourPackage(info.TourPackageId);
        }
        public void DeleteTourPackage(int tourPackageId)
        {
            SQL.DeleteTourPackage(tourPackageId);
        }
        public TourPackageInfo GetTourPackage(int tourPackageId)
        {
            return CBO.FillObject<TourPackageInfo>(SQL.GetTourPackage(tourPackageId));
        }
        public List<TourPackageInfo> ListTourPackage()
        {
            return CBO.FillCollection<TourPackageInfo>(SQL.ListTourPackage());
        }
        public DataTable SelectTourPackage()
        {
            return CBO.ConvertToDataTable(ListTourPackage(), typeof(TourPackageInfo));
        }
        public Dictionary<object, object> ListTourPackageLookup()
        {
            var pages = ListTourPackage();
            return pages.ToDictionary<TourPackageInfo, object, object>(info => info.TourPackageId, info => info.TourPackageName);
        }
    }
}
